/*****************************************************************************
 * Open MCT, Copyright (c) 2014-2016, United States Government
 * as represented by the Administrator of the National Aeronautics and Space
 * Administration. All rights reserved.
 *
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 * Open MCT includes source code licensed under additional open source
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 * this source code distribution or the Licensing information page available
 * at runtime from the About dialog for additional information.
 *****************************************************************************/
@mixin  spinner($b: 5px, $c: $colorKey) {
    @include transform-origin(center);
    @include animation-name(rotation-centered);
    @include animation-duration(0.5s);
    @include animation-iteration-count(infinite);
    @include animation-timing-function(linear);
    border-radius: 100%;
    box-sizing: border-box;
    border-color: rgba($c, 0.25);
    border-top-color: rgba($c, 1.0);
    border-style: solid;
    border-width: $b;
    display: block;
    position: absolute;
    left: 50%; top: 50%;
}

.wait-spinner {
	@include spinner($waitSpinnerBorderW, $colorKey);
	pointer-events: none;
	z-index: 2;
	&.inline {
		display: inline-block !important;
		margin-right: $interiorMargin;
		position: relative !important;
		vertical-align: middle;
	}
}

.loading {
	// Can be applied to any block element with height and width
    pointer-events: none;
    &:before,
    &:after {
        content: '';
    }
	&:before {
        @include spinner($waitSpinnerBorderW, $colorLoadingFg);
        height: $waitSpinnerD; width: $waitSpinnerD;
        z-index: 10;
	}
    &:after {
        @include absPosDefault();
        background: $colorLoadingBg;
        display: block;
        z-index: 9;
    }
    &.tree-item.t-wait-node {
        $d: $waitSpinnerTreeD;
        $spinnerL: $treeVCW + $interiorMargin + 3px + $d/2;
        padding-left: $spinnerL + $d/2 + $interiorMargin;
        .t-title-label {
            font-style: italic;
            opacity: 0.6;
        }
        &:before {
            height: $d;
            width: $d;
            border-width: 4px;
            left: $spinnerL;
        }
        &:after {
            display: none;
        }
    }
}
